import request from '@/utils/request'

// 查询初始化数据列表
export function listInitData(query) {
  return request({
    url: '/init/initData/list',
    method: 'get',
    params: query
  })
}

// 查询初始化数据详细
export function getInitData(id) {
  return request({
    url: '/init/initData/' + id,
    method: 'get'
  })
}

// 保存初始化数据
export function saveInitData(data) {
  return request({
    url: '/init/initData/save',
    method: 'post',
    data: data
  })
}

// 删除初始化数据
export function delInitData(id) {
  return request({
    url: '/init/initData/' + id,
    method: 'delete'
  })
}

// 导出初始化数据
export function exportInitData(query) {
  return request({
    url: '/init/initData/export',
    method: 'get',
    params: query
  })
}

// 导出模板
export function download(data) {
  return request({
    url: '/init/initData/download/' + data.implClassName + '/' + data.templateName,
    method: 'get'
  })
}

// 导入数据
export function upload(data) {
  return request({
    url: '/init/initData/upload/' + data.implClassName,
    method: 'post'
  })
}
